<?php

	class Account_history_model extends CI_Model {

		protected $__tbname = 'account_history';
		protected $__dbconf = 'default';

		var $id;	//int(10) unsigned	Primary Key	Auto Increment	NOT NULL
		var $id_account;	//int(11) unsigned			NOT NULL
		var $id_transaction;	//bigint(20) unsigned			NOT NULL
		var $date;	//date			NOT NULL
		var $amount;	//bigint(20) unsigned			NOT NULL
		var $balance;	//bigint(20) unsigned			NOT NULL
		var $actual_amount;	//bigint(20) unsigned			NOT NULL
		var $actual_balance;	//bigint(20) unsigned			NOT NULL
		var $creation_date = 'CURRENT_TIMESTAMP';	//timestamp			NOT NULL
		var $deleted;	//tinyint(1) unsigned			NOT NULL
		var $id_user_created;	//int(10) unsigned			NOT NULL
		var $modification_date;	//datetime			NULL
		var $id_user_modified;	//int(10) unsigned			NULL
		var $description;	//varchar(255)			NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'int', 'null' => FALSE, 'auto_increment' => TRUE),
			'id_account' => array('key' => 'MUL', 'type' => 'int', 'null' => FALSE),
			'id_transaction' => array('type' => 'bigint', 'null' => FALSE),
			'date' => array('type' => 'date', 'null' => FALSE),
			'amount' => array('type' => 'bigint', 'null' => FALSE),
			'balance' => array('type' => 'bigint', 'null' => FALSE),
			'actual_amount' => array('type' => 'bigint', 'null' => FALSE),
			'actual_balance' => array('type' => 'bigint', 'null' => FALSE),
			'creation_date' => array('type' => 'timestamp', 'null' => FALSE),
			'deleted' => array('type' => 'tinyint', 'null' => FALSE),
			'id_user_created' => array('type' => 'int', 'null' => FALSE),
			'modification_date' => array('type' => 'datetime', 'null' => TRUE),
			'id_user_modified' => array('type' => 'int', 'null' => TRUE),
			'description' => array('type' => 'varchar', 'size' => 255, 'null' => TRUE)
		);

		protected $__relation = array(
			array('table' => 'account', 'foreign_key' => 'id_account'),
			array('table' => 'transaction', 'foreign_key' => 'id_transaction')
		);
	}
